//
//  ACEStudentDetailListCommentCell.m
//  ACE
//
//  Created by zhangtao on 2018/8/10.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "ACEStudentDetailListCommentCell.h"

@implementation ACEStudentDetailListCommentCell
//
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {

        _starView = [[ACEStarView alloc]initWithFrame:CGRectMake(15, 10, 120, 20)];
        [self addSubview:_starView];
        
        _timeLab = [[UILabel alloc]initWithFrame:CGRectMake(self.frame.size.width-110, 10, 100, 15)];
        _timeLab.text = @"2018/07/31";
        [self addSubview:_timeLab];
        
        _commentLab = [[UILabel alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(_starView.frame)+10, self.frame.size.width-30, 20)];
        _commentLab.numberOfLines = 0;
        _commentLab.text = @"阿斯顿了房间；科技";
        [self addSubview:_commentLab];
    }
    return self;
}

//-(instancetype)initWithFrame:(CGRect)frame{
//    if (self = [super initWithFrame:frame]) {
//        _starView = [[ACEStarView alloc]initWithFrame:CGRectMake(15, 10, 120, 20)];
//        [self addSubview:_starView];
//        
//        _timeLab = [[UILabel alloc]initWithFrame:CGRectMake(frame.size.width-110, 10, 100, 15)];
//        _timeLab.text = @"2018/07/31";
//        [self addSubview:_timeLab];
//        
//        _commentLab = [[UILabel alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(_starView.frame), frame.size.width-30, 20)];
//        _commentLab.numberOfLines = 0;
//        _commentLab.text = @"阿斯顿了房间；科技";
//        [self addSubview:_commentLab];
//    }
//    return self;
//}


-(void)topRound{
    
//    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, ACEWidth-50, 20) byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopLeft cornerRadii:CGSizeMake(10, 10)];
//
//    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
//
//    maskLayer.frame =CGRectMake(0, 0, ACEWidth-20, 20);
//
//    maskLayer.path = maskPath.CGPath;
//    maskLayer.fillColor = [UIColor clearColor].CGColor;
//    maskLayer.strokeColor = deepGreen.CGColor;
//    self.layer.mask = maskLayer;

    

//    CAShapeLayer *maskLayer = [CAShapeLayer layer];
//    maskLayer.frame = self.frame;//CGRectMake(0, 0, cellWidth, cellHeight);
    CAShapeLayer *borderLayer = [CAShapeLayer layer];
    borderLayer.frame =  CGRectMake(0, 0, ACEWidth-20, 20);
    borderLayer.lineWidth = 1.f;
    borderLayer.strokeColor = lightGreen.CGColor;
    borderLayer.fillColor = [UIColor clearColor].CGColor;

    UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, ACEWidth-20, 20) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)];//[UIBezierPath bezierPathWithRoundedRect:self.frame cornerRadius:10];
//    maskLayer.path = bezierPath.CGPath;
    borderLayer.path = bezierPath.CGPath;

    [self.contentView.layer insertSublayer:borderLayer atIndex:0];
//    [self.layer setMask:maskLayer];

    
    
    /*
    self.layer.borderColor = [UIColor blueColor].CGColor;
    self.layer.borderWidth = 2;
    self.backgroundColor = [UIColor whiteColor];//[UIColor blackColor];
//    blackView.frame = CGRectMake(0, roundedCornersView.frame.size.height-55, roundedCornersView.frame.size.width, 55);
    //半边圆角
//    self.layer.borderColor = deepGreen.CGColor;
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = self.bounds;
    maskLayer.path = maskPath.CGPath;
//    maskLayer.fillColor  = [UIColor clearColor].CGColor;
    maskLayer.strokeColor    = [UIColor redColor].CGColor;
//    maskLayer.borderWidth = 5;
    self.layer.mask = maskLayer;
    
    [self.layer addSublayer:maskLayer]
     */
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
